#include<bits/stdc++.h>
using namespace std;
#pragma warning(disable:4996)
int n;
int hats[10001];
int hh[10001];
int arr[10001];
int aa[10001];
unordered_map<int, int> mp;


int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &hats[i]);
		hh[i] = hats[i];
	}
	for (int i = 1; i <= n; i++) {
		scanf("%d", &arr[i]); 
		aa[i] = arr[i];
	}
	sort(hh + 1, hh + 1 + n);
	sort(aa + 1, aa + 1 + n);
	for (int i = 1; i <= n; i++) {
		mp[hh[i]] = aa[i];
	}
	bool flag = false;
	for (int i = n; i > 0; i--) {
		int paople = mp[hats[i]];
		for (int j = 1; j <= n; j++) {
			if (arr[j] == paople) {
				if (flag)printf(" ");
				else flag = true;
				printf("%d", j);
			}
		}
	}

	system("pause");
	return 0;
}